function oooo() {
    $.ajax({
        url: '/my/user/userinfo',

        success: function(res) {
            if (res.status === 0) {
                let name = res.data.nickname || res.data.username
                $('.hy').text(name)
                if (res.data.user_pic) {
                    $('.layui-nav-img').attr('src', res.data.user_pic).show()
                    $('.tx').hide()
                } else {
                    let first = name.substr(0, 1).toUpperCase()
                    console.log(first)
                    $('.tx').text(first).css('display', 'inline-block')
                }




            }
        }

    })
}
oooo()
$('.tc').click(function() {


    // 弹出层，询问是否要退出
    layer.confirm('你确定退出吗？', function(index) {
        //do something
        // 如果点击了确定，删除token，页面跳转
        localStorage.removeItem('tk');
        location.href = './login.html';
        layer.close(index); // 关闭当前弹出层
    });
});
// $('.layui-body').hide()